<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>测试</title>
 <style type="text/css">
	#div1{
		background-color:red;
		width:500px;
		height:400px;
	}
 </style>
 <script type="text/javascript">
	function GetkeyCode(Myevent)
	{
		var Obj= document.getElementById("div1");
		alert(Obj);
		var stylevalue=Obj.style;
		alert(stylevalue);
		for(var key in stylevalue)
		{
			document.write(key + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ stylevalue[key] + "<br/>");
		}
	}
 </script>
 </head>
 <body onkeydown="GetkeyCode(event)">
	<div id="div1"></div>
 </body>
 </html>